<template>
  <TbTitle level="2" title="（二）本年度承接政府委托职能、购买服务项目、政府补贴情况" />
  <table border="0" class="m-table-pdf">
    <tr>
      <td rowspan="2" style="width: 5%">序号</td>
      <td rowspan="2" style="width: 10%">类型</td>
      <td rowspan="2" style="width: 15%">项目名称</td>
      <td rowspan="2" style="width: 12%">购买主体</td>
      <td colspan="2" style="width: 13%">项目周期</td>
      <td rowspan="2" style="width: 8%">项目资金（万元）</td>
      <td rowspan="2" style="width: 20%">
        活动介绍(含经济效益、社会效益等介绍)
      </td>
    </tr>
    <tr>
      <td>开始日期</td>
      <td>结束日期</td>
    </tr>
    <tr v-for="(item, index) in detailInfo">
      <td>{{ index + 1 }}</td>
      <td>{{ dictToVal(dict1, item.projectType) }}</td>
      <td>{{ item.projectName }}</td>
      <td>{{ item.purchasingEntity }}</td>
      <td>{{ item.startTime }}</td>
      <td>{{ item.endTime }}</td>
      <td>{{ item.projectFunding }}</td>
      <td>{{ item.achievementProblem }}</td>
    </tr>
  </table>
  <div class="msg-tip">

  </div>
</template>

<script setup lang="ts">
import TbTitle from '@/views/yearCheck/components/TbTitle.vue'
import { reactive, inject, ref } from 'vue'
import { getDictByCode } from '@/views/yearCheck/ykb/mf/mf'
const { getDetailInfo } = inject('getDetailInfo')
let detailInfo = reactive([])

getDetailInfo(9).then(res => {
  Object.assign(detailInfo, res.data)
})
const dict1 = ref([]);
getDictByCode("governmentalFunctions").then(response => {
  dict1.value = response.data;
});

const dictToVal = (dictList, val) => {
  for (let i = 0; i < dictList.length; i++) {
    if (val == dictList[i].id) {
      return dictList[i].name
    }
  }
}
</script>
<style lang="scss" scoped>
.msg-tip {
  padding: 20px 0;
  color: #000;
  font-family: '微软雅黑';
}
</style>
